<?php
namespace backend\models;

use Yii;
use yii\base\Model;

class BaseModel extends Model
{
    public $user_role;
    //判断当前用户登录角色
    public function init()
    {
        parent::init();

    }
    
    /**
     * 获取模型错误
     */
    /*public static function getErrorMessge($model, $isthrow = true)
    {
        $error = null;
        if ($model->hasErrors()) {
            $errors = $model->getErrors();
            foreach ($errors as $value) {
                $error = $value[0];
                break;
            }
        }
        if ($isthrow && !(null === $error)) {
            throw new OperateException($error);
        } elseif (!$isthrow && !(null === $error)) {
            return $error;
        } else {
            return true;
        }
    }*/
}
